package com.lupan.mutithred.cp3_Phaser;

import java.util.concurrent.Phaser;

/**
 * 说明：
 *
 * @author lupan
 * @version 2017/4/25 14:29
 */
public class Main {
    public static void main(String[] args) throws InterruptedException {

        Phaser phaser = new Phaser(5);

        for (int i = 0; i < 11; i++) {
            PhaserThread thread = new PhaserThread(phaser);
            thread.start();
        }

        Thread.sleep(2000);
        System.out.println("已到达："+phaser.getArrivedParties());
        System.out.println("未到达："+phaser.getUnarrivedParties());
    }
}
